<!DOCTYPE html>
<html>
<head>
    <title>部门管理</title>
    <#include "/common/import.ftl" >
    <script>
        $(function () {
            if ("${item.deptId!''}" != null && "${item.deptId!''}" != "") {
                $("#deptEname").attr("readonly", true);
            }
            $('#deptSaveForm').form({
                onSubmit: function () {
                    return $(this).form('validate');
                },
                success: function (data) {
                    var result = jQuery.parseJSON(data);
                    if (result.flag == 'T') {
                        $.messager.alert('提交结果', '操作成功!', 'info', function () {
                            parent.closeDeptWin();
                            if ("0" == "${item.fatherId!''}") {
                                parent.location.reload();
                            } else {
                                parent.reloadTree('${item.fatherId!""}', '${item.deptId!""}');
                            }
                        });
                    } else {
                        $.messager.alert('提交结果', result.msg, 'info');
                    }

                }
            });
        });


    </script>

<body>

<form id="deptSaveForm" name="deptSaveForm" method="post" action="save.action">
    <input type="hidden" name="formToken" id="formToken" value="${formToken!''}">
    <input type="hidden" name="deptId" id="deptId" value="${item.deptId!''}"/>
    <input type="hidden" name="fatherId" id="fatherId" value="${item.fatherId!''}"/>
    <input type="hidden" name="orgId" id="orgId" value="${item.orgId!''}"/>
    <input type="hidden" name="orgEname" id="orgEname" value="${item.orgEname!''}"/>
    <input type="hidden" name="updateCount" id="updateCount" value="${item.updateCount!''}"/>
    <input type="hidden" name="sysEname" id="sysEname" value="${item.sysEname!''}"/>
    <input type="hidden" name="subCount" id="subCount" value="${item.subCount!''}"/>
    <table class="datagrid-body">
        <tr>
            <td class="datagrid-header">所属机构</td>
            <td>${item.orgEname!''}
            </td>
        </tr>
        <tr>
            <td class="datagrid-header">部门名称<span style="color:red;">*</span></td>
            <td>
                <input name="deptCname" id="deptCname" value="${item.deptCname!''}"
                       class="easyui-validatebox" size="30"
                       data-options="required:true,validType:'length[2,30]'"
                       missingMessage="请输入部门名称" invalidMessage="应为2~30个字"/>
            </td>
        </tr>
        <tr>
            <td class="datagrid-header">部门标识<span style="color:red;">*</span></td>
            <td>
                <input id="deptEname" name="deptEname" value="${item.deptEname!''}"
                       class="easyui-validatebox" size="30"
                       data-options="required:true,validType:'english'"
                       missingMessage="请输入部门标识" invalidMessage=""/>
            </td>
        </tr>

        <tr>
            <td class="datagrid-header">部门经理<br/>(登录名)<span style="color:red;">*</span></td>
            <td><input id="deptRemark" name="deptRemark" value="${item.deptRemark!''}"
                       class="easyui-validatebox" size="30"
                       data-options="required:true,validType:'length[2,30]'"
                       missingMessage="请输入部门经理登录名" invalidMessage="应为2~30个字"/>
            </td>
        </tr>
        <tr>
            <td class="datagrid-header"></td>
            <td>

                <a href="#" class="easyui-linkbutton" iconCls="icon-save"
                   onClick="$('#deptSaveForm').form('submit');">保存</a>
                <!--
                                <input type="submit" value="提交"/>
                                  -->
            </td>
        </tr>

    </table>

</form>
</body>
</html>